﻿<%@ Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MedicalManagementSystem.Utils.PaginatedList<MedicalManagementSystem.Models.Patient>>"%>
<% if (Model.HasPreviousPage) { %>
    <a onclick = "javascript:getPatientTable(<%=Model.PageIndex-1%>)">
    <%=Html.Encode("<<<")%>
    </a>
<% } %>
<%if (Model.FirstPage >= 2) {%>
    <a onclick = "javascript:getPatientTable(0)">1</a>
    <%if(Model.FirstPage >= 3) {%>
        <b><%= "..."%></b>
    <%} %>
<%}%>
&nbsp;
<% if (Model.TotalPages >= 2) { 
     for (int i = Model.FirstPage; i <= Model.LastPage; ++i) { %>
        <% if (i - 1 == Model.PageIndex) { %>
            <b><%= i %></b>
        <% } else { %>
        <a onclick = "javascript:getPatientTable(<%=Html.Encode(i - 1)%>)"><%=Html.Encode(i)%></a>
        <% } %>
        &nbsp;
    <% } %>
<% } %>
<%if (Model.LastPage <= Model.TotalPages - 1) {%>
    <%if(Model.LastPage < Model.TotalPages - 1){ %>
        <b><%= "..."%></b>
    <%} %>
    <a onclick = "javascript:getPatientTable(<%=Html.Encode(Model.TotalPages - 1)%>)"><%=Html.Encode(Model.TotalPages)%></a>
 <%} %>
<% if (Model.HasNextPage) { %>
      <a onclick = "javascript:getPatientTable(<%=Html.Encode(Model.PageIndex + 1)%>)"><%=Html.Encode(">>>")%></a> 
<% } %>
